<template>
  <el-select
    v-model="strategy"
    v-bind="$attrs"
    clearable
    placeholder="请选择策略"
    class="select-strategy"
  >
    <el-option
      v-for="(item, index) in strategyList"
      :key="index"
      :label="item.name"
      :value="item.id"
    />
  </el-select>
</template>

<script setup lang="ts">
import { strategyList } from '@/indexDB/initStrategy'
import { computed } from 'vue'

const props = defineProps<{
  id: string | number
}>()

const emit = defineEmits(['update:id'])

const strategy = computed({
  get() {
    return props.id
  },
  set(val) {
    emit('update:id', val)
  }
})
</script>
